package com.cz.video.website.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.cz.video.common.core.validate.AddGroup;
import com.cz.video.common.core.validate.EditGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import javax.validation.constraints.Pattern;
import java.util.Date;

/**
 * <p>
 * 用户点赞
 * </p>
 *
 * @author 陈智
 * @since 2023-10-31
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Schema(title="用户点赞对象", description="用户点赞")
public class WebsiteLike {

    @TableId(value = "id")
    @Null(groups = {AddGroup.class})
    private Long id;

    @Schema(title = "源id")
    @NotNull(groups = {EditGroup.class, AddGroup.class})
    private Long sourceId;

    @Schema(title = "类型",description = "(0:点赞,1:点踩)")
    @Pattern(regexp = "^([01])$", message = "type字段值不合法",groups = {AddGroup.class, EditGroup.class})
    private Integer type;

    @Schema(title = "点赞者id")
    private Long userId;

    @Schema(title = "被点赞者id")
    private Long likedUserId;

    @Schema(title = "创建时间")
    private Date createTime;


}
